/** 
 * @module session
 * @description 缓存
 *  */
import Cookies from 'js-cookie';
import store from '@/store';

/**
 * vuex - 还原
 * @param {string} key key
 * @example this.$session.clearVuex();
 * */
export function clearVuex() {
  store.commit('SET_token', null);
  store.commit('SET_userinfo', null);
  store.commit('SET_apiShake', []);
  store.commit('SET_permissions', []);
  store.commit('SET_roles', []);
  store.commit('SET_routerList', []);
  store.commit('SET_menuList', []);
  store.commit('SET_menuOpenList', []);
  store.commit('SET_menuNowOpen', null);
  store.commit('SET_menuShrink', false);
  Cookies.remove('authorized-token');
}

export default {
  clearVuex
};
